"""
# 输出10次打招呼
i = 0
while i < 10:
    print("你好，李健奇")
    i += 1

# 求1-100的和
i = 1
m = 0
while i <= 100:
    m += i              # m=m+i
    i += 1               # i=i+1
print(f"1到100的和为：{m}")

# 设置1-100的整数随机变量，while循环猜数字，并输出猜测次数
import random
num = random.randint(1,100)     # 定义一个随机变量
count = 0       # 定义一个计数变量
flag = True     # 通过布尔值变量，判断循环是否继续
while flag:
    guess_num = int(input("请输入猜测的数字："))
    count += 1      # 统计猜测次数
    if guess_num == num:
        print("恭喜你猜中了")
        flag = False        # 设置终止循环条件
    else:
        if guess_num > num:
            print("大了")
        else:
            print("小了")
print(f"你猜了{count}次")

# while循环：打印九九表
i = 1
while i <= 9:
    j = 1
    while j <= i:
        print(f"{j}*{i} = {j*i}\t",end='')
        j += 1
    i += 1
    print()
"""
# for循环：打印九九表
for i in range(1,10):                           # 控制行数
    for j in range(1,i+1):                     # 控制每一行数据
        print(f"{j}*{i} = {j*i}\t",end='')
    print()